<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>投诉</title>
    <link href="../../layuiadmin/js/adm/css/bootstrap.css" rel="stylesheet">
    <script src="../../layuiadmin/js/adm/js/vue.js"></script>
    <script src="../../layuiadmin/js/adm/js/vue-resource.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.min.js"></script>
    <script src="../../layuiadmin/js/adm/js/bootstrap.js"></script>
    <script src="../../layuiadmin/js/adm/js/getUrlParam.js"></script>
    <script src="../../layuiadmin/js/adm/js/date.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.cookie.js"></script>
</head>
<body>
    <div id="app" class="container-fluid"  style="margin: 20px 5%" >
        <form class="form-inline">
            <div class="row">
                <input type="text" class="form-control" v-model="cname" placeholder="请输入客户名称">&nbsp;
                开始时间：
                <input type="date" class="form-control" v-model="kdate">
                结束时间：
                <input type="date" class="form-control" v-model="jdate">
                <input type="button" class="btn btn-primary" @click="postss()" value="检索">
            </div>
            <div class="row" style="margin-top: 20px">
                
                <table class="table table-condensed table-hover">
                    <thead>
                        <tr>
                            <th>提交内容</th>
                            <th>案件</th>
                            <th>客户名称</th>
                            <th>联系电话</th>
                            <th>提交时间</th>
                            <th>回复数量</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="item in complain">
                            <td>{{item.complainContent}}</td>
                            <td>{{item.caseId}}</td>
                            <td>{{item.complainName}}</td>
                            <td>{{item.complainPhone}}</td>
                            <td>{{item.complainDate}}</td>
                            <td>{{item.statt}}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
    

    <script>
          var vm=new Vue({
            el:'#app',
            data:{
                complain:[

                ],
                cname:"",
                kdate:"",
                jdate:""
            },
            methods: {
                postinfo(){
                    this.$http.post('http://localhost:8080/complain/listall',{},{emulateJSON:true}).then(resutl =>{
                        var dat=eval("("+resutl.body+")")
                        if(dat!=null&&dat!=""){
                            this.complain=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.complain.push(dat[i])
                            }
                        }else{
                            alert("网络丢失")
                        }
                    })
                },
                postss(){
                    this.$http.post('http://localhost:8080/complain/furry',{"cname":this.cname,"kdate":this.kdate,"jdate":this.jdate},{emulateJSON:true}).then(resutl =>{
                        var dat=eval("("+resutl.body+")")
                            this.complain=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.complain.push(dat[i])
                            }
                    })
                }
            },
            created () {
                this.postinfo()
            }
        })      
    </script>

</body>
</html>